﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;

namespace mBlog.ViewModels
{
    public class CommentInput
    {
        public long PostId { get; set; }

        [Required(ErrorMessage = "请输入你的名字")]
        [MaxLength(20)]
        public string Author { get; set; }

        [Required(ErrorMessage = "请输入内容")]
        public string Content { get; set; }

        [Required(ErrorMessage = "请输入你的Email地址")]
        [MaxLength(250, ErrorMessage = "这么长的Email地址?")]
        [RegularExpression(@"\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", ErrorMessage = "Email地址不合法")]
        public string Email { get; set; }

        public string Site { get; set; }
        public string IP { get; set; }
    }
}